Calculating Business Days – Alteryx version of NETWORKDAYS
Introduction
Sometime ago a colleague asked whether there is any equivalent function as NETWORKDAYS in Alteryx. I was baffled at first, but later on created an equivalent workflow in Alteryx to solve the problem.
Usually HR team, Project manager or Payroll manager heavily rely on this functionality in Excel to calculate number of working days. One can even register a list of holidays and have them excluded while calculating the number of workdays within a period. The syntax for Excel is: NETWORKDAYS( start_date, end_date, [holidays] ) Alteryx equivalent is as described in this blogpost.
Workflow
Add your dates into the workflow in this format, (yyyy-mm-dd). Calculate the day as shown below.
Now add a filter to remove weekends (Saturday and Sunday).
You can add a list of other fixed holidays such as public holidays and join it with the primary data to exclude those holidays as shown below.
In the above step,all holidays are removed from the combined data. In order to calculate the number of business days, we need to pick the first date by sorting the dates ascendingly and picking-up the first date as shown below.
The first date obtained from previous step is added to the primary data as a new column.
Finally, the number of business days are calculated as shown here.
Conclusion
So by using this workflow you can re-create the desired functionality in Alteryx to count the number of business days. If you are subscribed with our company as a registered user, then you can download this workflow from a specified webportal.